﻿using HarmonyLib;
using RimWorld;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;

namespace RimZombieGirl
{
    [HarmonyPatch(typeof(CompRefuelable), "CompInspectStringExtra")]
    public static class Patch_CompRefuelable_CompInspectStringExtra
    {
        public static bool Prefix(CompRefuelable __instance, ref string __result)
        {
            if (__instance.parent?.def?.defName == "RI_Building_ZombieTransformationCoffin")
            {
                return false; 
            }

            return true; 
        }
    }

    //[HarmonyPatch(typeof(Building_TransformationCoffin), "GetGizmos")]
    //public static class Patch_Building_TransformationCoffin_GetGizmos
    //{
    //    public static void Postfix(Building_TransformationCoffin __instance, ref IEnumerable<Gizmo> __result)
    //    {
    //        if (__instance.def.defName == "RI_Building_ZombieTransformationCoffin")
    //        {
    //            // 去掉“打开”按钮
    //            __result = __result.Where(g =>
    //            {
    //                if (g is Command_Action cmd)
    //                {
    //                    if (cmd.defaultLabel != null && cmd.defaultLabel.Contains("Open"))
    //                        return false;
    //                    if (cmd.action?.Method.Name == "Open")
    //                        return false;
    //                }
    //                return true;
    //            });
    //        }
    //    }
    //}
}
